<!DOCTYPE html>
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('液氮出库列表')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">

        <div class="col-sm-12 search-collapse">
            <span class="btn-group " role="group" style="margin: 0px auto;display: table;">
                <button class="top-link btn btn-sm btn-white" id="ncYedan" type="button">液氮管理</button>
                <button class="top-link btn-sm btn-primary" id="ncYedanLog" type="button">出库记录</button>
            </span>
        </div>


        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <!--	<li>
                                液氮id：<input type="text" name="yedanId"/>
                            </li>-->

                        <li class="select-time">
                            <label>出库时间： </label>
                            <input class="time-input" id="beginTime" name="params[beginTime]" placeholder="开始时间"
                                   type="text"/>
                            <span>-</span>
                            <input class="time-input" id="endTime" name="params[endTime]" placeholder="结束时间"
                                   type="text"/>
                        </li>
                        <li>
                            来源：<input name="comeFrom" type="text"/>
                        </li>
                        <!--<li>
                            库存(升)：<input type="text" name="stockAmout"/>
                        </li>

                        <li>
                            出库数量(升)：<input type="text" name="outputAmount"/>
                        </li>-->

                        <li>
                            领取人:
                            <select  id="receiver"  name="receiver">
                                <option value="" selected="selected">无</option>
                                <option th:each="user:${users}" th:text="${user.loginName}"
                                        th:value="${user.loginName}"></option>
                            </select>
                        </li>

                        <li>
                            经手人:
                            <select  id="createBy"  name="createBy">
                                <option value="" selected="selected">无</option>
                                <option th:each="user:${users}" th:text="${user.loginName}"
                                        th:value="${user.loginName}"></option>
                            </select>
                        </li>

                        <li>
                            备注：<input name="remark" type="text"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ncYedanLog:add">
                <i class="fa fa-plus"></i> 添加
            </a>-->
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:ncYedanLog:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:ncYedanLog:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
           <!-- <a class="btn btn-info" onclick="$.table.importExcel()">
                <i class="fa fa-upload"></i> 导入
            </a>-->
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncYedan:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table data-mobile-responsive="true" id="bootstrap-table"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncYedanLog:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncYedanLog:remove')}]];
    var prefix = ctx + "system/ncYedanLog";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "液氮出库",
            showExport: true,
            uniqueId : "yedanLogId",
            columns: [{
                checkbox: true
            },
                {
                    title: '序号',
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field: 'yedanLogId',
                    title: '',
                    visible: false
                },
                {
                    field: 'yedanId',
                    title: '液氮id',
                    sortable: true,
                    visible: false
                },

                {
                    field: 'createTime',
                    title: '出库时间',
                    sortable: true
                },
                {
                    field: 'comeFrom',
                    title: '来源',
                    sortable: true
                },
                {
                    field: 'stockAmout',
                    title: '库存(升)',
                    sortable: true
                },
                {
                    field: 'outputAmount',
                    title: '出库数量(升)',
                    sortable: true
                },
                {
                    field: 'receiver',
                    title: '领取购人',
                    sortable: true
                },
                {
                    field: 'createBy',
                    title: '经手人',
                    sortable: true
                },
                {
                    field: 'remark',
                    title: '备注',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.yedanLogId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.yedanLogId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);

        $("#ncYedan").click(function () {
            window.location.href = ctx + 'system/ncYedan';

        });

        $("#ncYedanLog").click(function () {
            window.location.href = ctx + 'system/ncYedanLog';


        });
    });
    setTitle("兽医管理-液氮管理-出库记录",true)
</script>
</body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <!--                                <input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在，更新这条数据。"> 是否更新已经存在的用户数据-->
                &nbsp;	<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
            </div>
            <font color="red" class="pull-left mt10">
                提示：仅允许导入“xls”或“xlsx”格式文件！
            </font>
        </div>
    </form>
</script>
</html>